﻿/*----------------------------------------------------------------
 * 
 * 版权所有：Copyright (C) 2013
 * 
 * 文件名：IManagerDocument.cs
 * 文件功能描述：
 * 
 * 
 * 作 者：zhangq
 * 邮 箱：ifunnyface@outlook.com
 * 日 期：2013-03-07 15:34:15
 * 
 * 
 * 修改标识： Author
 * 修改描述： 相关描述
 * 
 * ---------------------------------------------------------------- */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Common.Extensions.OrderBy;
using DomainModel;

namespace IManager
{

    /// <summary>
    /// 
    /// </summary>
    public interface IManagerDocument
    {
        /// <summary>
        /// 通过documentId获取
        /// </summary>
        /// <param name="documentId">documentId</param>
        /// <returns>DocumentInfo</returns>
        DocumentInfo GetDocument(int documentId);


        /// <summary>
        /// 添加信息
        /// </summary>
        /// <param name="documentInfo">信息</param>
        /// <returns>True=操作成功/False=操作失败</returns>
        bool AddDocument(DocumentInfo documentInfo);


        /// <summary>
        /// 删除信息
        /// </summary>
        /// <param name="documentIdList">Id列表</param>
        /// <returns>True=操作成功/False=操作失败</returns>
        bool DeleteDocument(IList<int> documentIdList);


        /// <summary>
        /// 更新信息
        /// </summary>
        /// <param name="documentInfo">信息</param>
        /// <returns>True=操作成功/False=操作失败</returns>
        bool UpdateDocument(DocumentInfo documentInfo);


        /// <summary>
        /// 根据条件分页获得记录
        /// </summary>
        /// <param name="where">条件</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页大小</param>
        /// <param name="orderByExpressions">排序字段</param>
        /// <returns>记录列表</returns>
        IList<DocumentInfo> LoadAll(Expression<Func<DocumentInfo, bool>> where,
                                                   int pageIndex,
                                                   int pageSize,
                                                   params IOrderByExpression<DocumentInfo>[] orderByExpressions);


        /// <summary>
        /// 获取总数
        /// </summary>
        /// <param name="where">条件</param>
        /// <returns>记录总数</returns>
        int LoadCount(Expression<Func<DocumentInfo, bool>> where);

         
    }

}